﻿using BlogDemo.Core.Interface;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace BlogDemo.Infrastructure.Database
{
    public class UnitOfWork
        : IUnitOfWork
    {
        private readonly BlogContext _ctx;
        public UnitOfWork(BlogContext ctx)
        {
            _ctx = ctx;
        }
        public async Task<bool> SaveChangesAsync()
        {
            return await _ctx.SaveChangesAsync() > 0;
        }
    }
}
